import time
from threading import Thread
from threading import local
import threading
class Foo(local):
	pass


foo = Foo()

foo.num = 0


def add(i):
	foo.num = i
	time.sleep(1)
	print(foo.num,threading.currentThread().ident)

if __name__ == '__main__':
	for i in range(9999):# 0 1
		task = Thread(target=add,args=(i,))
		task.start()


